<template>
    <div>
        <div class="standard-item">
            <!-- <div class="standard-name"
                 @click="showChild(item.DeptId,item)">
                <span>{{item.DeptName}}</span>
                <i class="iconfont icon-jinru"
                   :class="{'open':item.open}"></i>
            </div> -->

            <ul>
                <li v-for="(childItem,childIndex) in item"
                    v-bind:key="childIndex">
                    <standardItem :item="childItem"
                                  :showChild="showChild"
                                  :selectStandard="selectStandard"
                                  v-if="childItem.child"></standardItem>
                    <p
                       @click="selectStandard(childItem)">
                        <i class="iconfont checkbox"
                           :class="[childItem.checked?'icon-selected':'icon-checkbox-noselected']"></i>
                        <span>{{childItem.DeptName}}</span>
                    </p>

                </li>
            </ul>
        </div>
    </div>
</template>
<script>
export default {
    name: 'standardItem',
    props: {
        item: Array,
        showChild: Function,
        selectStandard: Function
    },
}
</script>
<style scoped>
.standard-item {
    background: #fff;
}
.standard-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 24px;
    margin-right: 20px;
}
.standard-name span {
    color: #333;
    font-size: 13px;
    line-height: 16px;
}
.standard-name i {
    transform: rotate(90deg);
}
.standard-item .open {
    transform: rotate(-90deg);
}
.standard-item li {
    display: flex;
    align-items: center;
    min-height: 55px;
    /* padding: 10px 20px 10px 0; */
    padding-left: 10px;
    border-top: 1px solid #efeff4;
    font-size: 13px;
}
.standard-item li .standard-name {
    min-height: 55px;
    padding: 0;
    margin-right: 0;
}
.standard-item li .checkbox {
    margin-top: -1px;
    margin-right: 10px;
    font-size: 16px;
}
.standard-item li .icon-selected {
    color: #2269ff;
}
.standard-item p {
    display: flex;
    line-height: 22px;
    color: #333;
    padding-right: 20px;
}
.standard-item li > div {
    flex: 1;
    padding-right: 20px;
}
</style>
